package leetcode;


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedHashSet;

/**
 * create by duanx 2022/2/7
 *@classname: Test3
 *@author: duanx
 *@date: 2022/2/7 9:22
 **/
public class Test9 {

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str;
        try{
            while(!(str=reader.readLine()).isEmpty()) {
                if (str.length()>8){
                    return;
                }
                LinkedHashSet<Character> set = new LinkedHashSet<>();
                int i=str.length()-1;
                while (i>=0) {
                    char c = str.charAt(i);
                    set.add(c);
                    i--;
                }
                StringBuilder stringBuilder = new StringBuilder();
                for (char c: set){
                    stringBuilder.append(c);
                }
                System.out.println(stringBuilder);
            }
        }catch (Exception e){
            System.out.println(e.getMessage());
        }

    }


}
